<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
// api版本控制
$v = request()->header('Api-Version');
// 默认api版本为v1
if ($v == null) $v = "v1";

Route::resource('index','.Index')->middleware('CheckToken');
Route::resource('order', $v . '.Order')->middleware('CheckToken');
Route::resource('goods', $v . '.Goods')->middleware('CheckToken');
Route::resource('info', $v . '.Info')->middleware('CheckToken');


Route::post('indexx','api/v1.Indexx/indexx')->middleware('CheckToken'); //查询
Route::post('Modindex','api/v1.add/index')->middleware('CheckToken');  //查询
Route::post('Modsave','api/v1.add/save')->middleware('CheckToken');   //添加